import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Window 2.2

ChatRoomForm {
    property int dpi :Screen.desktopAvailableHeight/400
    imgSize:Qt.size(34*dpi,34*dpi)
    headImgSize:Qt.size(48*dpi,48*dpi)
    trangleImgSize:Qt.size(20*dpi,20*dpi)

    Drawer {
        id: drawer
        width: parent.width
        height: 80*dpi
        edge: Qt.BottomEdge
    }

    Component.onCompleted: {
        //drawer.open()
    }

    addMouseArea.onClicked:{
        drawer.open()
    }

    voiceMouseArea.onClicked: {
        chatController.chatAudio.inputToggleMode();
    }

    Connections{
        target: chatController.chatAudio
        onInputStateChanged:{
            if(audioState == 0 ){
                state = "openVoice";
            }else if(audioState == 1 || audioState == 2){
                state = "closeVoice";
            }
        }
    }

    Connections{
        target: messageInput
        onEditingFinished:{
            chatController.inputMessageSend(messageInput.text)
        }
    }
}
